/*
 *  $Id: DamageType.cs 1200 2010-11-22 12:19:43Z thenn.erannor $
 *	This file is a part of Ragima CCG.
 *	(C) 2008 Ragima development group.
 *
 *	Licensed under the terms of the GNU GPL License version 2.
 *
 */

using System.Collections.Generic;

using AgateLib.Geometry;

using Ragima.Helper;
using Ragima.Languages;

namespace Ragima {
    /// <summary>
    /// Тип урона, определяемый названием и цветом
    /// Вместо перечислимого типа является классом с приватным конструктором и несколькими статическими экземплярами
    /// </summary>
    public class DamageType: INamed {
        public static readonly DamageType PhysicalAttack = new DamageType("physical", 0xff0000.ToColor(), true);
        public static readonly DamageType Wound = new DamageType("wound", 0xff0000.ToColor(), true);
        public static readonly DamageType Darkness = new DamageType("darkness", 0x8000ff.ToColor(), false);
        public static readonly DamageType Fire = new DamageType("fire", 0xff8000.ToColor(), false);
        public static readonly DamageType MagicAttack = new DamageType("magic", 0x4040ff.ToColor(), false);
        public static readonly DamageType Health = new DamageType("health", 0x008000.ToColor(), false);
        public static readonly DamageType Regeneration = new DamageType("regeneration", 0x008000.ToColor(), false);

        private const string LocalePrefix = "damage.";

        private string _id;
        private Names _name, _affectName;
        private Color _color;
        private bool _spirit;

        private DamageType(string id, Color color, bool spirit) {
            _id = id;
            _name = new Names(LocalePrefix+id, false);
            _affectName = new Names(LocalePrefix+id+".affect", false);
            _color = color;
            _spirit = spirit;
        }

        public string Id { get { return _id; } }
        public Names Name { get { return _name; } }
        public Names AffectName { get { return _affectName; } }
        public Color Color { get { return _color; } }
        public bool ImmuneBySpirit { get { return _spirit; } }
    }
}